package com.ax.associator.store.common.log;


import com.ax.associator.store.common.utils.base.Const;

/**
 * 用户类型
 * 
 * @author Melody
 * @date 2018年4月3日 下午4:20:57
 */
public enum UserType {
	USER(1, "前端用户"), EMPLOYEE(2, "后端用户");

	private int id;

	private String value;

	private UserType(int id, String value) {
		this.id = id;
		this.value = value;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static UserType fromId(int id) {
		switch (id) {
		case 1:
			return USER;
		case 2:
			return EMPLOYEE;
		}
		throw new RuntimeException(String.format(Const.USER_TYPE, id));
	}
}
